package com.wk.search.controller;

import com.wk.common.bean.Resp;
import com.wk.search.entity.SearchParam;
import com.wk.search.service.SearchService;
import com.wk.search.vo.SearchResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @GetMapping
    public Resp<SearchResponseVO> search(SearchParam param) {
        SearchResponseVO responseVO = searchService.search(param);
        return Resp.ok(responseVO);
    }

}
